package lab03.test01;

import java.io.*;

public class test01 {
    public static void main(String[] args) throws IOException {
        String path = "D:\\hello.txt";
        //1.字符流来读
        //1.1一次读一行字符
        BufferedReader reader = null;
        try {
            reader = new BufferedReader(new FileReader(path));
            String line = "";
            while ((line = reader.readLine()) != null) {
                line = reader.readLine();
                System.out.println(line);
            }


        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {

            reader.close();
        }
        //2.读字节流
//        FileOutputStream fileOutputStream=new FileOutputStream(path);
//        //每一次写的是一个或者多个整数
//        fileOutputStream.write(65);
//        byte a;
//        byte[]date=new byte[3];



    }
}
